﻿/*****************************************************************************  

 Version: 0.1
 Website: http://www.visuagile.com/
 
 Copyright (c) Yoganand R. All rights reserved.
 For continued development and updates, visit http://yogsbreath.net
 
 ******************************************************************************/

#region Imports

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

using VisualAgile.IBLL;
using VisualAgile.IDAL;
using VisualAgile.Model;

#endregion


namespace VisualAgile.BLL
{
    public class FeatureManager : BaseManager<Feature>, IFeatureManager
    {
        #region Properties

        public IFeatureDao FeatureDao { get; set; }

        #endregion

        protected override IBaseDao<Feature> getBaseDAO()
        {
            return FeatureDao;
        }

        /// <summary>
        /// Create a user (the default value contains the return)
        /// </summary>
        /// <returns></returns>
        public Feature NewFeature()
        {
            var feature = new Feature();

            //System configuration can be used
            feature.CreateTime = DateTime.Now;
            feature.Name = "New Feature";
            feature.Target = DateTime.Now.AddDays(27);
            feature.FullSize = true;            

            return feature;
        }

        /// <summary>
        /// Stories by project
        /// </summary>
        /// <param name="userId">Project ID</param>
        /// <returns></returns>
        public IList GetByProject(Guid projectId)
        {
            return FeatureDao.FindByProject(projectId);
        }

        /// <summary>
        /// Access to Features
        /// </summary>
        /// <param name="ProjectName">project Id</param>
        /// <returns></returns>
        public IList GetByRelease(string ReleaseID)
        {
            return FeatureDao.FindByRelease(ReleaseID);
        }
    }
}
